package com.yc.AOP.test.aop1.config;

import com.yc.AOP.test.aop1.dao.BookDao;
import com.yc.AOP.test.aop1.dao.BookDaoImpl;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration
@EnableAspectJAutoProxy
@ComponentScan(basePackages = "com.yc.AOP.test.aop1")
public class Aopconfig {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(Aopconfig.class);
        BookDao bean = ac.getBean(BookDao.class);
        bean.save();
        bean.update();
        bean.selectAll(1);
    }
}
